package samoloty.data;

import java.util.ArrayList;
import samoloty.model.IDataModel;
import samoloty.model.models.AcRegModel;
import samoloty.model.models.ConfigurationModel;
import samoloty.model.models.ConstModel;
import samoloty.model.models.CrewModel;
import samoloty.model.models.FuelModel;
import samoloty.model.models.HoldsModel;
import samoloty.model.models.IdealTrimModel;
import samoloty.model.models.LimitLawModel;
import samoloty.model.models.LimitTowModel;
import samoloty.model.models.LimitTowffModel;
import samoloty.model.models.LimitZfwModel;
import samoloty.model.models.LimitZfwffModel;
import samoloty.model.models.MaxWeightsModel;
import samoloty.model.models.PantryModel;
import samoloty.model.models.PaxModel;
import samoloty.model.models.StabTrimModel;
import samoloty.model.models.StabTrimSubModel;
import samoloty.model.models.StabTrimSubSubModel;

public class DataBase9 extends CommonDataBase implements IDataModel {

    public DataBase9() {
        super();
        initData();
    }

    public ArrayList<String> getAcReg() {
        return acRegData;
    }

    public ArrayList<ConfigurationModel> getConfiguration() {
        return configuration;
    }

    public ConstModel getConst() {
        return constData;
    }

    public ArrayList<CrewModel> getCrew() {
        return crewData;
    }

    public ArrayList<FuelModel> getFuel() {
        return fuelData;
    }

    public ArrayList<HoldsModel> getHolds() {
        return holdsData;
    }

    public ArrayList<LimitLawModel> getLimitLaw() {
        return limitLawData;
    }

    public ArrayList<LimitTowModel> getLimitTow() {
        return limitTowData;
    }

    public ArrayList<LimitTowffModel> getLimitTowff() {
        return limitTowffData;
    }

    public ArrayList<LimitZfwModel> getLimitZfw() {
        return limitZfwData;
    }

    public ArrayList<LimitZfwffModel> getLimitZfwff() {
        return limitZfwffData;
    }

    public MaxWeightsModel getMaxWeights() {
        return maxWeightsData;
    }

    public PantryModel getPantry() {
        return pantryData;
    }

    public ArrayList<PaxModel> getPax() {
        return paxData;
    }

    public StabTrimModel getStabTrimFlap1() {
        return stabTrimFlap1Data;
    }

    public StabTrimModel getStabTrimFlap2() {
        return stabTrimFlap2Data;
    }

    public StabTrimModel getStabTrimFlap3() {
        return stabTrimFlap3Data;
    }

    public StabTrimModel getStabTrimFlap4() {
        return stabTrimFlap4Data;
    }

    public ArrayList<IdealTrimModel> getIdealTrim() {
        return idealTrimData;
    }

    private void initData() {
        initAcReg();
        initConst();
        initCrew();
        initConfiguratin();
        initFuel();
        initHolds();
        initLimitTow();
        initLimitZfw();
        initPantry();
        initPax();
        initMaxWeights();
        initStabTrimFlap1();
        initStabTrimFlap2();
        initIdealTrim();
    }

    private void initAcReg() {
        acRegData = new ArrayList<String>();
        acRegData.add(new String("SP-LLK"));
        acRegData.add(new String("SP-LLL"));

    }

    private void initConst() {
        constData = new ConstModel(30000, 40, 648.5, 625.6, 134.5);
    }

    private void initCrew() {
        crewData = new ArrayList<CrewModel>();
        crewData.add(new CrewModel("2/0", 2, 0, 170, -3.143));
        crewData.add(new CrewModel("2/3", 2, 3, 395, -4.430));
        crewData.add(new CrewModel("2/4", 2, 4, 470, -3.284));
        crewData.add(new CrewModel("2/5", 2, 5, 545, -2.138));
        crewData.add(new CrewModel("2/6", 2, 6, 620, -0.992));
        crewData.add(new CrewModel("3/0", 3, 0, 255, -4.715));
        crewData.add(new CrewModel("3/3", 3, 3, 480, -6.002));
        crewData.add(new CrewModel("3/4", 3, 4, 555, -4.856));
        crewData.add(new CrewModel("3/5", 3, 5, 630, -3.710));
        crewData.add(new CrewModel("3/6", 3, 6, 705, -2.564));
        crewData.add(new CrewModel("4/0", 4, 0, 340, -6.287));
        crewData.add(new CrewModel("4/3", 4, 3, 565, -7.574));
        crewData.add(new CrewModel("4/4", 4, 4, 640, -6.428));
        crewData.add(new CrewModel("4/5", 4, 5, 715, -5.282));
        crewData.add(new CrewModel("4/6", 4, 6, 790, -4.136));

    }

    private void initConfiguratin() {
        configuration = new ArrayList<ConfigurationModel>();
        configuration.add(new ConfigurationModel("Y162", 0, 162, 0, 60, 0, 36, 0, 66));
        configuration.add(new ConfigurationModel("C8Y144", 8, 144, 8, 42, 0, 36, 0, 66));
        configuration.add(new ConfigurationModel("C12Y138", 12, 138, 12, 36, 0, 36, 0, 66));
        configuration.add(new ConfigurationModel("C16Y132", 16, 132, 16, 30, 0, 36, 0, 66));
        configuration.add(new ConfigurationModel("C20Y126", 20, 126, 20, 24, 0, 36, 0, 66));
        configuration.add(new ConfigurationModel("C24Y120", 24, 120, 24, 18, 0, 36, 0, 66));
        configuration.add(new ConfigurationModel("C28Y114", 28, 114, 28, 12, 0, 36, 0, 66));
        configuration.add(new ConfigurationModel("C32Y108", 32, 108, 32, 6, 0, 36, 0, 66));
        configuration.add(new ConfigurationModel("C36Y102", 36, 102, 36, 0, 0, 36, 0, 66));
        configuration.add(new ConfigurationModel("C48Y84", 48, 84, 36, 0, 12, 18, 0, 66));
        configuration.add(new ConfigurationModel("C52Y78", 52, 78, 36, 0, 16, 12, 0, 66));
        configuration.add(new ConfigurationModel("C56Y72", 56, 72, 36, 0, 20, 6, 0, 66));
        configuration.add(new ConfigurationModel("C60Y66", 60, 66, 36, 0, 24, 0, 0, 66));
        configuration.add(new ConfigurationModel("C64Y60", 64, 60, 36, 0, 24, 0, 4, 60));
        configuration.add(new ConfigurationModel("C68Y54", 68, 54, 36, 0, 24, 0, 8, 54));
        configuration.add(new ConfigurationModel("C72Y48", 72, 48, 36, 0, 24, 0, 12, 48));
        configuration.add(new ConfigurationModel("C76Y42", 76, 42, 36, 0, 24, 0, 16, 42));
        configuration.add(new ConfigurationModel("C80Y36", 80, 36, 36, 0, 24, 0, 20, 36));
        configuration.add(new ConfigurationModel("C84Y30", 84, 30, 36, 0, 24, 0, 24, 30));
        configuration.add(new ConfigurationModel("C88Y24", 88, 24, 36, 0, 24, 0, 28, 24));
        configuration.add(new ConfigurationModel("C162", 162, 0, 60, 0, 36, 0, 66, 0));
        configuration.add(new ConfigurationModel("C152", 152, 0, 50, 0, 36, 0, 66, 0));

    }

    private void initFuel() {
        fuelData = new ArrayList<FuelModel>();
        fuelData.add(new FuelModel(0, 0.0));
        fuelData.add(new FuelModel(500, -0.7));
        fuelData.add(new FuelModel(1000, -1.2));
        fuelData.add(new FuelModel(1500, -1.7));
        fuelData.add(new FuelModel(2000, -2.1));
        fuelData.add(new FuelModel(2500, -2.4));
        fuelData.add(new FuelModel(3000, -2.7));
        fuelData.add(new FuelModel(3500, -3.0));
        fuelData.add(new FuelModel(4000, -3.2));
        fuelData.add(new FuelModel(4500, -3.4));
        fuelData.add(new FuelModel(5000, -3.5));
        fuelData.add(new FuelModel(5500, -3.7));
        fuelData.add(new FuelModel(6000, -3.7));
        fuelData.add(new FuelModel(6500, -3.8));
        fuelData.add(new FuelModel(7000, -3.6));
        fuelData.add(new FuelModel(7500, -3.0));
        fuelData.add(new FuelModel(8000, -2.1));
        fuelData.add(new FuelModel(8500, -1.0));
        fuelData.add(new FuelModel(9000, 0.3));
        fuelData.add(new FuelModel(9111, 0.7));
        fuelData.add(new FuelModel(9500, 0.1));
        fuelData.add(new FuelModel(10000, -0.7));
        fuelData.add(new FuelModel(10500, -1.4));
        fuelData.add(new FuelModel(11000, -2.2));
        fuelData.add(new FuelModel(11500, -3.0));
        fuelData.add(new FuelModel(12000, -3.8));
        fuelData.add(new FuelModel(12500, -4.5));
        fuelData.add(new FuelModel(13000, -5.3));
        fuelData.add(new FuelModel(13500, -6.1));
        fuelData.add(new FuelModel(14000, -6.8));
        fuelData.add(new FuelModel(14500, -7.6));
        fuelData.add(new FuelModel(15000, -8.4));
        fuelData.add(new FuelModel(15500, -9.3));
        fuelData.add(new FuelModel(16000, -10.3));
        fuelData.add(new FuelModel(16140, -10.6));

    }

    private void initHolds() {
        holdsData = new ArrayList<HoldsModel>();
        holdsData.add(new HoldsModel("1", 1245, -0.01248));
        holdsData.add(new HoldsModel("2", 2059, -0.00757));
        holdsData.add(new HoldsModel("3", 3062, 0.00623));
        holdsData.add(new HoldsModel("4", 1125, 0.01227));

    }

    private void initLimitZfw() {
        limitZfwData = new ArrayList<LimitZfwModel>();
        limitZfwData.add(new LimitZfwModel(30000, 25.0, 30000, 48.4));
        limitZfwData.add(new LimitZfwModel(53070, 12.6, 31751, 50.1));

    }

    private void initLimitTow() {
        limitTowData = new ArrayList<LimitTowModel>();
        limitTowData.add(new LimitTowModel(30000, 35.7, 30000, 42.4));
        limitTowData.add(new LimitTowModel(45932, 26.4, 31751, 44.1));
        limitTowData.add(new LimitTowModel(47656, 26.6, 43998, 60.2));
        limitTowData.add(new LimitTowModel(51742, 25.5, 53070, 63.1));
        limitTowData.add(new LimitTowModel(56245, 22.6, 56245, 64.2));
        limitTowData.add(new LimitTowModel(60554, 20.3, 68038, 66.3));
        limitTowData.add(new LimitTowModel(68038, 25.4, 68038, 66.3));

    }

    private void initPantry() {
        pantryData = new PantryModel(1043, -0.01610, 0, 0, 1029, 0.01709);

    }

    private void initPax() {
        paxData = new ArrayList<PaxModel>();
        paxData.add(new PaxModel("0A", -0.00878));
        paxData.add(new PaxModel("0B", -0.00002));
        paxData.add(new PaxModel("0C", 0.00835));

    }

    private void initMaxWeights() {
        maxWeightsData = new MaxWeightsModel(68265, 68038, 53070, 56245);
    }

    private void initStabTrimFlap1() {
        ArrayList<StabTrimSubModel> stabTrimSub = new ArrayList<StabTrimSubModel>();
        ArrayList<StabTrimSubSubModel> stabMacs1 = new ArrayList<StabTrimSubSubModel>();
        stabMacs1.add(new StabTrimSubSubModel(5, 5.2));
        stabMacs1.add(new StabTrimSubSubModel(30, 1.7));
        stabTrimSub.add(new StabTrimSubModel("FLAPS 5", 30000, stabMacs1));
        ArrayList<StabTrimSubSubModel> stabMacs2 = new ArrayList<StabTrimSubSubModel>();
        stabMacs2.add(new StabTrimSubSubModel(5, 5.2));
        stabMacs2.add(new StabTrimSubSubModel(30, 1.7));
        stabTrimSub.add(new StabTrimSubModel("", 45359, stabMacs2));
        ArrayList<StabTrimSubSubModel> stabMacs3 = new ArrayList<StabTrimSubSubModel>();
        stabMacs3.add(new StabTrimSubSubModel(5, 5.7));
        stabMacs3.add(new StabTrimSubSubModel(30, 2.2));
        stabTrimSub.add(new StabTrimSubModel("", 45360, stabMacs3));
        ArrayList<StabTrimSubSubModel> stabMacs4 = new ArrayList<StabTrimSubSubModel>();
        stabMacs4.add(new StabTrimSubSubModel(5, 5.7));
        stabMacs4.add(new StabTrimSubSubModel(30, 2.2));
        stabTrimSub.add(new StabTrimSubModel("", 61233, stabMacs4));
        ArrayList<StabTrimSubSubModel> stabMacs5 = new ArrayList<StabTrimSubSubModel>();
        stabMacs5.add(new StabTrimSubSubModel(5, 6.2));
        stabMacs5.add(new StabTrimSubSubModel(30, 2.7));
        stabTrimSub.add(new StabTrimSubModel("", 61234, stabMacs5));
        ArrayList<StabTrimSubSubModel> stabMacs6 = new ArrayList<StabTrimSubSubModel>();
        stabMacs6.add(new StabTrimSubSubModel(5, 6.2));
        stabMacs6.add(new StabTrimSubSubModel(30, 2.7));
        stabTrimSub.add(new StabTrimSubModel("", 68038, stabMacs6));
        stabTrimFlap1Data = new StabTrimModel(stabTrimSub);
    }

    private void initStabTrimFlap2() {
        ArrayList<StabTrimSubModel> stabTrimSub = new ArrayList<StabTrimSubModel>();
        ArrayList<StabTrimSubSubModel> stabMacs1 = new ArrayList<StabTrimSubSubModel>();
        stabMacs1.add(new StabTrimSubSubModel(5, 4.6));
        stabMacs1.add(new StabTrimSubSubModel(30, 0.6));
        stabTrimSub.add(new StabTrimSubModel("FLAPS 15", 30000, stabMacs1));
        ArrayList<StabTrimSubSubModel> stabMacs2 = new ArrayList<StabTrimSubSubModel>();
        stabMacs2.add(new StabTrimSubSubModel(5, 4.6));
        stabMacs2.add(new StabTrimSubSubModel(30, 0.6));
        stabTrimSub.add(new StabTrimSubModel("", 45359, stabMacs2));
        ArrayList<StabTrimSubSubModel> stabMacs3 = new ArrayList<StabTrimSubSubModel>();
        stabMacs3.add(new StabTrimSubSubModel(5, 5.1));
        stabMacs3.add(new StabTrimSubSubModel(30, 1.1));
        stabTrimSub.add(new StabTrimSubModel("", 45360, stabMacs3));
        ArrayList<StabTrimSubSubModel> stabMacs4 = new ArrayList<StabTrimSubSubModel>();
        stabMacs4.add(new StabTrimSubSubModel(5, 5.1));
        stabMacs4.add(new StabTrimSubSubModel(30, 1.1));
        stabTrimSub.add(new StabTrimSubModel("", 61233, stabMacs4));
        ArrayList<StabTrimSubSubModel> stabMacs5 = new ArrayList<StabTrimSubSubModel>();
        stabMacs5.add(new StabTrimSubSubModel(5, 5.6));
        stabMacs5.add(new StabTrimSubSubModel(30, 1.6));
        stabTrimSub.add(new StabTrimSubModel("", 61234, stabMacs5));
        ArrayList<StabTrimSubSubModel> stabMacs6 = new ArrayList<StabTrimSubSubModel>();
        stabMacs6.add(new StabTrimSubSubModel(5, 5.6));
        stabMacs6.add(new StabTrimSubSubModel(30, 1.6));
        stabTrimSub.add(new StabTrimSubModel("", 65000, stabMacs6));
        stabTrimFlap2Data = new StabTrimModel(stabTrimSub);
    }

    private void initIdealTrim() {
        idealTrimData = new ArrayList<IdealTrimModel>();
        idealTrimData.add(new IdealTrimModel(30000, 40));
        idealTrimData.add(new IdealTrimModel(53070, 40));

    }

    public String getLabel() {
        return "B737-4Q8-HGW (162 seats)";
    }
    private ArrayList<String> acRegData;
    private ConstModel constData;
    private ArrayList<CrewModel> crewData;
    private ArrayList<ConfigurationModel> configuration;
    private ArrayList<FuelModel> fuelData;
    private ArrayList<HoldsModel> holdsData;
    private ArrayList<LimitZfwModel> limitZfwData;
    private ArrayList<LimitTowModel> limitTowData;
    private ArrayList<LimitLawModel> limitLawData;
    private ArrayList<LimitZfwffModel> limitZfwffData;
    private ArrayList<LimitTowffModel> limitTowffData;
    private PantryModel pantryData;
    private ArrayList<PaxModel> paxData;
    private MaxWeightsModel maxWeightsData;
    private StabTrimModel stabTrimFlap1Data;
    private StabTrimModel stabTrimFlap2Data;
    private StabTrimModel stabTrimFlap3Data;
    private StabTrimModel stabTrimFlap4Data;
    private ArrayList<IdealTrimModel> idealTrimData;
}
